import socket
port = 54321
#host = "137.138.196.188"
host="0.0.0.0"
UDPsock=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Accepte les datagrammes UDP sur le port depuis tous les expediteurs
UDPsock.bind((host, port))
#UDPsock.connect(('137.138.196.188',port))
print "Ecoute sur port", port
while 1:
    data, addr = UDPsock.recvfrom(128)
#    print "Recu:", data , "de", addr
#    print "Recu:", data 
    if not data:
        print "Client has exited!"
        break
    else:
        print "\nReceived message '", data,"' from ", addr    
